In mobile communication, a transmitted data stream may have bit error due to fading of wireless channels; therefore, it is necessary to process the data stream through channel coding to improve error correcting capability and reliability of data transmission. However, channel coding is only effective when detecting and correcting a single bit error and a bit error string that is not very long, and in practical applications, bit errors often arise in string, and channel coding will not correct errors normally when there is a relatively long bit error string.
In order to solve this problem, it needs to separate the successive bits in a message, i.e., the successive bits in a message are transmitted in an unsuccessive way. In this way, even if errors arise in string in the process of transmission, the bit errors can become errors in single or a short bit string when being restored into a message with a successive bit string, in which case, the initial message can be restored by correcting the errors through channel coding. This method is precisely the interleaving technology, i.e., in the uplink, the data to be transmitted are interleaved, and the successive bits are transmitted in unsuccessive way out of sequence; in the downlink, the interleaved data received are de-interleaved, and the unsuccessive out-of-sequence bits are restored into successive bits. The interleaving process is divided into first and second interleaving in the uplink and corresponding first and second de-interleaving in the downlink.
In the 3rd generation (3G) wireless communication, a data packet can be divided into several data frames, these data frames are transmitted in different transmitting channels respectively, and the transmission time for each data frame is 10 ms. The 3rd generation partnership project (3GPP) protocol specifies different delay requirements, according to which, the time interval for transmitting data may be 10 ms, 20 ms, 40 ms or 80 ms, i.e., 1 data frame, 2 data frames, 4 data frames or 8 data frames may be transmitted respectively. First interleaving means interleaving between data frames, i.e., the above data frames are subjected to inter-frame interleaving before being mapped to the physical channel, rather than directly mapped to the physical channel sequentially; second interleaving means interleaving between data carried in a single physical channel, which uses a method of writing the data into an interleaving matrix, and the specific process of second interleaving comprises the following steps of:
Step 11, constructing an interleaving matrix.
Generally, the number of columns of the interleaving matrix regulated by second interleaving is fixed as 30, while the number of rows is calculated according to the data that need to be transmitted in the channel, i.e., dividing the length M of the data to be transmitted with 30, if it is exactly divided, then the quotient m obtained therefrom is just the number of rows of the interleaving matrix; if it cannot be exactly divided, then the number of rows of the interleaving matrix is m+1. Then a bidimensional array is initialized according to the number of columns and the calculated number of rows, and the address determined by the bidimensional array is used to indicate the interleaving matrix.
Step 12, writing the data to be transmitted into the interleaving matrix one by one according to the sequence of rows, wherein if the length M of the data to be transmitted is not a multiple of 30, i.e., the data to be transmitted cannot fill out the interleaving matrix, so it needs to fill invalid data one by one into the blanks at the end of the last row of the interleaving matrix, and the invalid data can be empty bits.
Step 13, replacing the data in the columns of the interleaving matrix according to the inter-column replacement rule regulated by 3GPP.
Table 1 is a replacement table for columns of interleaving formulated according to inter-column replacement rule, for example, the position of the data in column 0 before interleaving does not change, the data in column 20 before interleaving is replaced by the data in column 1 after interleaving, the data in column 10 before interleaving is replaced by the data in column 2 after interleaving, the data in column 5 before interleaving is replaced by the data in column 3 after interleaving, thus replacing the sequences of all the columns in the interleaving matrix according to the rule. After replacement, the row number and column number of matrix wherein the data is located are obtained.
TABLE 1Sequence of column data before<0, 1, 2, 3, 4, . . . 26, 27, 28, 29>interleavingSequence of column data after<0, 20, 10, 5, 15, 25, 3, 13, 23, 8,interleaving18, 28, 1, 11, 21, 6, 16, 26, 4, 14,24, 19, 9, 29, 12, 2, 7, 22, 27, 17>
When the length M of the data to be transmitted is not a multiple of 30, the invalid data stored at the end of the interleaving matrix is also replaced according to the above inter-column replacement rule, for example, when the length M of the data to be transmitted is 27, the interleaving matrix is 1 row×30 column, and the last three columns, i.e., column 27, 28 and 29, store the invalid data. As shown in Table 1, the data in column 27 before interleaving is replaced by the data in column 28 after interleaving, the data in column 28 before interleaving is replaced by the data in column 12 after interleaving, and the data in column 29 before interleaving is replaced by the data in column 24 after interleaving. After interleaving, the invalid data and the data to be transmitted are crosswise arranged in the interleaving matrix.
Step 14, reading out the data to be transmitted from the interleaving matrix after column replacement according to the row number and column number in a sequence of columns, the interleaving process completed.
It should be noted that the invalid data and the data to be transmitted are crosswise arranged in the interleaving matrix, so that if they are sent out indifferentially, unnecessary wideband will be occupied. Therefore, a better method is to calculate whether the end of the interleaving matrix stores invalid data. When reading out each data, it is judged whether the data is invalid data or not. If it is not invalid data, then directly read it out; otherwise, skip it and read out the next data.
The process of second de-interleaving is just opposite to that of second interleaving, and comprises the following steps of:
Step 21, constructing a de-interleaving matrix.
The number of columns of the de-interleaving matrix regulated by second de-interleaving is fixed as 30, while the number of rows is calculated according to the data received in the channel, i.e., dividing the length TV of the received data with 30, if it is exactly divided, then the quotient n obtained therefrom is just the number of rows of the de-interleaving matrix; if it cannot be exactly divided, then the number of rows of the de-interleaving matrix is n+1. Then a bidimensional array is initialized according to the number of columns and the calculated number of rows, and the address determined by the bidimensional array is used to represent the de-interleaving matrix.
Step 22, writing the received data into the de-interleaving matrix one by one according to the sequence of columns, wherein if the length TV of the received data is not a multiple of 30, i.e., the received data cannot fill out the de-interleaving matrix, so it needs to fill invalid data one by one into the blanks at the end of the last row of certain columns of the de-interleaving matrix, and the invalid data can be empty bits.
Step 23, replacing the data in the columns of the de-interleaving matrix according to the inter-column replacement rule regulated by 3GPP.
Table 2 is a replacement table for columns of de-interleaving formulated according to inter-column replacement rule, which is just opposite to that of interleaving, for example, the position of the data in column 0 before de-interleaving does not change, the data in column 1 before de-interleaving is replaced by the data in column 20 after de-interleaving, the data in column 2 before de-interleaving is replaced by the data in column 10 after de-interleaving, the data in column 3 before de-interleaving is replaced by the data in column 5 after de-interleaving, thus replacing the sequences of all the columns in the de-interleaving matrix according to the rule. It can be seen that the data after de-interleaving are restored into the array before data interleaving. After replacement, the row number and column number of the matrix wherein the data is located are obtained.
When the length TV of the received data is not a multiple of 30, the invalid data stored at the end of certain columns of the de-interleaving matrix are also replaced according to the above inter-column replacement rule, for example, when the length TV of the received data is 27, the de-interleaving matrix is 1 row×30 column, and the last three columns, i.e., column 27, 28 and 29, store the invalid data. As shown in Table 1, the data in column 27 before de-interleaving is replaced by the data in column 22 after de-interleaving, the data in column 28 before de-interleaving is replaced by the data in column 27 after de-interleaving, and the data in column 29 before de-interleaving is replaced by the data in column 17 after de-interleaving. Before column replacement, the invalid data and the received data are crosswise arranged in the de-interleaving matrix.
TABLE 2sequence of column data before<0, 1, 2, 3, 4, . . . 26, 27, 28, 29>de-interleavingsequence of column data after<0, 12, 25, 6, 18, 3, 15, 26, 9, 22,de-interleaving2, 13, 24, 7, 19, 4, 16, 29, 10, 21,1, 14, 27, 8, 20, 5, 17, 28, 11, 23>
Step 24, reading out the received data from the de-interleaving matrix after column replacement according to the row number and column number in a sequence of rows.
It should be noted that when writing data into the de-interleaving matrix, the last rows of certain columns should be filled with invalid data. Therefore, it needs to calculate the filling positions of the invalid data. When reading out each data, it is judged whether the data is invalid data or not. If it is not invalid data, then directly read it out; otherwise, skip it and read out the next data.
It can be seen from the above analysis that the method for interleaving and de-interleaving in the prior art has the following problems:
1) when constructing an interleaving matrix or a de-interleaving matrix, it needs to calculate the number of rows occupied by the data written into the matrix by using division, which is complicated and requires a special division operation unit in terms of hardware.
2) invalid data are filled when the data cannot fill out the interleaving matrix or de-interleaving matrix, correspondingly, it needs to know by calculation which data are invalid data in the matrix, thus increasing the complexity of calculation.